package com.itheima.domain.vo;

import cn.hutool.core.bean.BeanUtil;
import com.itheima.domain.db.UserInfo;
import com.itheima.domain.mongo.Voice;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class VoiceVo implements Serializable {

    private String userId;//语音用户id
    private String soundUrl;//语音地址
    private Integer remainingTimes;//剩余次数

    private String avatar;//语音用户头像
    private String nickname;//语音用户昵称
    private String gender;//语音用户性别
    private Integer age;//语音用户年龄


    // 设置用户信息
    public void setUserInfo(UserInfo userInfo) {
        if (userInfo != null) {
            BeanUtil.copyProperties(userInfo, this);
        }
    }

    // 设置用户信息
    public void setVoice(Voice voice) {
        if (voice != null) {
            BeanUtil.copyProperties(voice, this);
        }
    }
}
